package ssm.strategy;

public class Player {
	private String name;
	private Strategy strategy;
	private int winCnt;
	private int loseCnt;
	private int gameCnt;
	
	public Player(String name, Strategy strategy) {
		this.name = name;
		this.strategy = strategy;
	}
	
	public Hand nextHand(){
		return strategy.nextHand();
	}
	
	public void win(){ // 승리
		strategy.study(true);
		winCnt++;
		gameCnt++;
	}
	
	public void lose(){ // 패배
		strategy.study(false);
		loseCnt++;
		gameCnt++;
	}
	
	public void even(){ // 무승부
		gameCnt++;
	}
	
	@Override
	public String toString() {
		return "[" + name + " : " + gameCnt + " games, " + winCnt + " win, " + loseCnt + " lose" + "]";
	}
}
